﻿@using Webdiyer.WebControls.Mvc
@model PagedList<EAM.Model.AssetBrandSupply>
@{
    ViewBag.Title = "品牌供应商列表";
}
@if (false)
{
    <script src="../../Scripts/jquery-1.5.1-vsdoc.js" type="text/javascript"></script>
}
<div style="padding: 5px 10px;">
    <a href="@Url.Action("edit", "BrandSupply", new { id = -1 })" class="btn_green">新建分类</a>
</div>
<div style="padding: 0px 10px; margin-bottom: 5px;">
    <table id="searchbox" class="tb" width="98%" style="text-align: center;">
        <tr>
            <td style="width: 60px;">供应商类型</td>
            <td>
                @Html.DropDownList("BrandSupplyType", "请选择类型")
            </td>
            <td>
                <input type="button" id="search" class="btn_green" value="查询" onclick="f_search()" /></td>
        </tr>
    </table>
    <script type="text/javascript">
        function f_search() {
            var url = window.location.pathname + '?' + $("#searchbox :input, #searchbox select").serialize();
            window.location = url;
        }
    </script>
</div>
<div style="padding: 0px 10px;">
    <table class="tb" width="98%" style="text-align: center;">
        <tr>
            <th style="width: 20px;"></th><th valign="top">编号</th><th>资产类型名称</th><th>联系人</th><th>联系方式</th><th>供应商类型</th><th>地址</th><th>操作</th>
        </tr>
        @foreach (var m in Model)
        {
            <tr>
                <td>
                    <input type="checkbox" /></td>
                <td>@m.BrandSupplyID</td>
                <td>@m.BrandSupplyName</td>
                <td>@m.BrandSupplyContactMember</td>
                <td>@m.BrandSupplyContactPhone</td>
                <td>@( ((Dictionary<int, string>)ViewData["BrandSupplyTypeList"])[(int)@m.BrandSupplyType])</td>
                <td>@m.BrandSupplyAddress</td>
                <td width="80">
                    <a href="@Url.Action("edit", "BrandSupply", new { id = m.BrandSupplyID })">编辑</a>
                    <a  style="display:none;" href="@Url.Action("del", "BrandSupply", new { id = m.BrandSupplyID })" onclick="return confirm('确认删除吗？')">删除</a>
                </td>
            </tr>
        }
        <tr>
            <td>
                <input type="checkbox" /></td>
            <td colspan="7" style="text-align: left;">
                <div style="float: left;">
                    <input type="button" value="删除" class="btn_red"  style="display:none;"/>
                </div>
                <div style="float: right;">
                    @Html.Pager(Model)
                </div>
            </td>
        </tr>
    </table>
</div>

